<{include file="public/header.html"}> 
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<script type="text/javascript">var share_type="wenda";</script>
	<!--问答回答 首页-->
	<header class="title-fixed w100">
            <div class="title title-border-sm bj-white">
                <a href="javascript:;" class="title-top title-left col-red iconfont" onclick="javascript:history.go(-1);">&#xe604;</a>
                <a href="javascript:;" class="titleToggle title-top title-right iconfont col-red">&#xe6a0;</a>
                <div class="title-toggle bj-white" style='display: none;'>
                        <b></b>
                        <ul>
                            <li class="<{if $item['is_care']}>follow2<{else}>follow<{/if}>">
                                <a href="javascript:;" class="collection _care_btn" data-val="<{$item['is_care']}>"><font class="iconfont mr5">&#xe634;</font><i><{if $item['is_care']}>已关注<{else}>关注<{/if}></i></a>
                            </li>
                            <li><a href="javascript:;" class="collection _report_btn" data-rel="<{$item['detail_url']}>"><font class="iconfont mr5">&#xe624;</font>举报</a></li>
                        </ul>
                </div>
                <input type="hidden" id="wenda-info" data-wid="<{$item['wenda_id']}>" data-uid="<{$item['questioner_uid']}>" data-title="《<{$item['title_s']}>》--溜溜问答专栏" data-desc="<{$item['summary_s']}>" data-link="<{$item['detail_url']}>" data-thumb="<{eval url('')}>static/default/img/share-thumb.png"/>
                <h1 class="text-center name">溜溜问答</h1>
            </div>
	</header>
	<!--问答回答 内容-->
	<div class="wd-answer mt50 mb60">
            <div class="plr15 ptb20 border-bottom-sm bj-grey">
                <p class="anwer-title"><{$item['title']}></p>
            </div>
            <div class="plr15 ptb10 answer bj-grey">
                <div class="user-head ptb5 f-cb">
                    <div class="fl">
                        <img src="<{$item['head_img']}>" class="head fl"/>
                        <span class="name fl ml5"><{$item['nickname']}></span>
                    	<img src="<{$style_dir}>/img/vip/vip1.png" class="badge fl ml5"/>
                    </div>
                    <p class="time fr"><{$item['create_time']}></p>
                </div>
                <{if $item['content']}>
                <div class="text-all hide">
                    <{$item['content']}>
                </div>
                <{/if}>
                <{if $item['content']}>
                <button class="w100 hide">
                    <i class="iconfont col-grey999 a">&#xe633;</i>
                    <i class="iconfont col-grey999 b disnone">&#xe6f7;</i>
                </button>
                <{/if}>
            </div>
            <div class="plr15 pt10">
                <p class="con-title mb10">回答区</p>
            </div>
            <ul id="content-list">
            </ul>
            <div class="loading" id="noresults" style="display: none;">
                <a href="javascript:;" class="load-success empty-load">
                    <img src="<{$style_dir}>/img/none/none1.jpg">
                </a>
            </div>
            <div class="loading" id="loading">
                <a class="/*pull-load*/ load-success" href="javascript:;">加载中...</a>
            </div>
            <div class="loading" id="nomoreresults" style="display: none;">
                <a href="javascript:;" class="load-success nomore-load">已经到底啦~~~</a>
            </div>
	</div>
	<!--问答回答 底部悬浮-->
	<div class="bottom w100">
            <div class="bottom-wd-answer bj-white">
                <a href="javascript:;" class="<{if $item['is_self']}>col-grey999<{else}>col-red<{/if}>" id="answer-add-btn" data-val="<{$item['is_answer']}>">回答<b></b></a>
                <a href="javascript:;" class="publicShare col-red _share_wenda">分享</a>
            </div>
	</div>
	<!--分享 弹窗-->
	<div class="public-field-bj publick-jq2 share-wenda-box ">
            <div class="public-field-share w100 bj-grey share-content-box">
                <div class="plr10 ptb30">
                    <ul class="f-cb" id="share-box">
                        <li data-type="sina"><a href="javascript:;" class="iconfont icon-weibo" >&#xe611;</a><p>微博</p></li>
                        <li data-type="qq-space"><a href="javascript:;" class="iconfont icon-space">&#xe7dc;</a><p>QQ空间</p></li>
                    </ul>
                </div>
                <a href="javascript:;" class="btn close-jq bj-white _close">取&nbsp;消</a>
            </div>
	</div>
        <!--分享提示弹窗-->
        <div class="public-field-bj publick-jq5" id="wx-share" style="display: none;">
                <img src="<{$style_dir}>/img/share.png">
        </div>
        <script type="text/javascript" src="/static/js/native-sha-1.0.js"></script>
        <script type="text/javascript" src="/static/js/scrollpagination.js"></script>
        <script type="text/javascript" src="/static/js/wenda-min-1.0.js"></script>
        <script type="text/javascript">
	$(function(){
            var appid = "<{$wxjsapi_config['appid']}>";
            var timestamp = "<{$wxjsapi_config['timestamp']}>";
            var nonceStr = "<{$wxjsapi_config['nonceStr']}>";
            var signature = "<{$wxjsapi_config['signature']}>";
            wx.config({
                debug: false,appId: appid,timestamp: timestamp,nonceStr: nonceStr, signature: signature,
                jsApiList:['checkJsApi','onMenuShareTimeline','onMenuShareWeibo','onMenuShareAppMessage','onMenuShareQQ','onMenuShareQZone' ] 
            });
            var _a = $("#wenda-info"),_t=_a.attr("data-title"),_d=_a.attr("data-desc"),_l=_a.attr("data-link"),_i=_a.attr("data-thumb");
            wx.ready(function(){
                wx.onMenuShareAppMessage({title:_t,desc:_d,link:_l,imgUrl:_i,type: '',dataUrl: '',success: function () {},cancel: function () {}});
                wx.onMenuShareTimeline({title:_t,desc:_d,link:_l,imgUrl:_i,success: function () {},cancel: function () {}});
                wx.onMenuShareQQ({title:_t,desc:_d,link:_l,imgUrl:_i,type: '',dataUrl: '',success: function () {},cancel: function () {}});
                wx.onMenuShareWeibo({title:_t,desc:_d,link:_l,imgUrl:_i,success: function () {},cancel: function () {}});
                wx.onMenuShareQZone({title:_t,desc:_d,link:_l, imgUrl:_i,success: function () {},cancel: function () {}});
            });
            showWdRead();
            var currentPage = 0;
            $('#content-list').scrollPagination({
                'contentPage': "/ajax/ajax_fetch_wenda_answer",
                'contentData': {
                    'wendaId': $("#wenda-info").attr("data-wid"),
                    'pageIndex': currentPage
                },
                'scrollTarget': $(window),
                'heightOffset': 0,
                'beforeLoad': function() { // before load function, you can display a preloader div
                    $('#loading').fadeIn('fast');
                    $('#loading').attr('scrollpagination','disabled');
                },
                'afterLoad': function(elementsLoaded) { // after loading content, you can use this function to animate your new elements
                    $('#loading').fadeOut('fast');
                    $('#loading').attr('scrollpagination','enabled');
                    if (elementsLoaded.length == 0) {
                        if(currentPage != 0){
                            $('#nomoreresults').fadeIn('slow');
                        }
                        $('#content-list').stopScrollPagination();
                    }else{
                        currentPage = currentPage + 1;
                    }
                    if(elementsLoaded.length != 0 && currentPage == 1){
                        $('#nomoreresults').fadeIn('slow');
                    }
                    if(elementsLoaded.length == 0 && currentPage == 0){
                        $("#noresults").fadeIn('slow');
                    }else{
                        this.contentData.pageIndex = currentPage;
                        $(elementsLoaded).fadeInWithDelay();
                    }
                    if ($('#content-list').children().length > 100) { // if more than 100 results already loaded, then stop pagination (only for testing)
                        $('#nomoreresults').fadeIn();
                        $('#content-list').stopScrollPagination();
                    };
                }
            });     
            $.fn.fadeInWithDelay = function() {
                var delay = 0;
                return this.each(function() {
                    $(this).delay(delay).animate({
                        opacity: 1
                    }, 200);
                    delay += 100;
                });
            };
            $("#answer-add-btn").on("click",function(){
                if(!_is_login()){return;}
                var _val = $(this).attr("data-val");
                if(is_login.uuid == $("#wenda-info").attr("data-uid")){$.mvalidateTip("不能自问自答哦");return;};
                if(_val == 1){
                    $.mvalidateTip("不能重复回答哦");return;
                }else{
                    window.location.href="<{$item['answer_add_url']}>";
                }
                
            });
	});
        </script>
<{include file="public/footer.html"}> 

